@echo off

REM get MYSQL_DIR from environment / launch config.
SET PATH=%PATH%;%MYSQL_DIR%\bin;

if "%SECURITY%"=="yes" goto Setup
goto Abort

:Setup
echo The database tinybank will be prepared for test.
echo For that case the environment variable MYSQL_DIR must point
echo to the installation path of the mysql server.
echo To configure this environment variable select 
echo "External Tool Configurations":
echo Under programs select "SetupDatabase". 
echo On the right panel select the "Environment" tab. 
echo Here you can edit the MYSQL_PATH variable to your mysql server installation.
echo The actual path value of MYSQL_DIR is:
echo %MYSQL_DIR%
echo 
echo Path: %PATH%
echo CurrDir: %CD%
echo MySQLDir: %MYSQL_DIR%
echo.
echo Starting setup ...

mysql -uroot -pmysql --force < 0_SetupDatabase.sql
echo ...Setup finished.

goto Exit

:Abort
echo Setup aborted!

:Exit